#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
char str1[5000];
char str2[5000];
int main()
{
	int n;
	cin >> n;
	int k = 1;
	int f = n;
	while (n--)
	{
		cin >> str1;
		cin >> str2;	
		int arr[5000] = { 0 };
		int brr[5000] = { 0 };
		int result[5000] = { 0 };
		int len1 = strlen(str1);
		int len2 = strlen(str2);
		int z = 0;
		for (int i = len1 - 1; i >= 0; i--)
		{
			arr[z++] = str1[i] - '0';
		}
		z = 0;
		for (int i = len2 - 1; i >= 0; i--)
		{
			brr[z++] = str2[i] - '0';
		}
		z = 0;
		int t = 0;
		int Max = max(len1, len2);
		for (int i = 0; i <= Max; i++)
		{
			t = arr[i] + brr[i];
			if (t >= 10) {
				t -= 10;
				brr[i + 1]++;
			}
			result[i] = t;
		}
		int MaxIndex = Max;
		if (result[Max] == 0)
		{
			MaxIndex = Max - 1;
		}
		//
		cout << "Case " << k << ":" << endl;
		for (int i = 0; i < len1; i++)
		{
			cout << str1[i] - '0';
		}
		cout << " + ";
		for (int i = 0; i < len2; i++)
		{
			cout << str2[i] - '0';
		}
		cout << " = ";
		for (int i = MaxIndex; i >= 0; i--)
		{
			cout << result[i];
		}
		cout << endl;
		if (k<f) {
			cout << endl;
		}
		k++;
	}
	return 0;
}